import request from '@/utils/request'

/**
 * * 获取 - 部门列表
 * @returns Promise 对象
 */
export const getDepartmentsListAPI = () => {
  return request({
    url: '/company/department'
  })
}

/**
 * * 获取 - 员工简单列表(只有员工id 和 姓名)
 * @returns Promise 对象
 */
export const getEmployeesSimpleListAPI = () => {
  return request({
    url: '/sys/user/simple'
  })
}

/**
 * * 新增 - 子部门
 * @returns Promise 对象
 */
export const addDepartmentsAPI = (data) => {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

/**
 * * 修改 - 子部门
 * @returns Promise 对象
 */
export const updateDepartmentsAPI = (data) => {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}

/**
 * * 删除 - 子部门
 * @returns Promise 对象
 */
export const deleteDepartmentsAPI = (id) => {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}
